package com.modbus.tcp.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.modbus.tcp.mapper.AlarmdatahisMapper;
import com.modbus.tcp.domain.Alarmdatahis;
import com.modbus.tcp.service.IAlarmdatahisService;
import com.modbus.tcp.utils.Convert;
import org.springframework.web.bind.annotation.RestController;

/**
 * 历史报警数据 服务层实现
 *
 * @author d
 * @date 2024-05-13
 */
@RestController
public class AlarmdatahisServiceImpl implements IAlarmdatahisService {

    @Autowired
    private AlarmdatahisMapper alarmdatahisMapper;

    /**
     * 查询历史报警数据信息
     *
     * @param alarmhistoryid 历史报警数据ID
     * @return 历史报警数据信息
     */
    @Override
    public Alarmdatahis selectAlarmdatahisById(Long alarmhistoryid) {
        return alarmdatahisMapper.selectAlarmdatahisById(alarmhistoryid);
    }

    /**
     * 查询历史报警数据列表
     *
     * @param alarmdatahis 历史报警数据信息
     * @return 历史报警数据集合
     */
    @Override
    public List<Alarmdatahis> selectAlarmdatahisList(Alarmdatahis alarmdatahis) {
        return alarmdatahisMapper.selectAlarmdatahisList(alarmdatahis);
    }

    /**
     * 新增历史报警数据
     *
     * @param alarmdatahis 历史报警数据信息
     * @return 结果
     */
    @Override
    public int insertAlarmdatahis(Alarmdatahis alarmdatahis) {
        return alarmdatahisMapper.insertAlarmdatahis(alarmdatahis);
    }

    /**
     * 修改历史报警数据
     *
     * @param alarmdatahis 历史报警数据信息
     * @return 结果
     */
    @Override
    public int updateAlarmdatahis(Alarmdatahis alarmdatahis) {
        return alarmdatahisMapper.updateAlarmdatahis(alarmdatahis);
    }

    /**
     * 删除历史报警数据对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAlarmdatahisByIds(String ids) {
        return alarmdatahisMapper.deleteAlarmdatahisByIds(Convert.toStrArray(ids));
    }
}